home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / uconv / nsICharsetConverterManager.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-05-08  |  12.9 KB  |  297 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsICharsetConverterManager.idl
  3.  */
  4.  
  5. #ifndef __gen_nsICharsetConverterManager_h__
  6. #define __gen_nsICharsetConverterManager_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsISupportsArray_h__
  14. #include "nsISupportsArray.h"
  15. #endif
  16.  
  17. #ifndef __gen_nsIAtom_h__
  18. #include "nsIAtom.h"
  19. #endif
  20.  
  21. /* For IDL files that don't want to include root IDL files. */
  22. #ifndef NS_NO_VTABLE
  23. #define NS_NO_VTABLE
  24. #endif
  25. #include "nsIUnicodeDecoder.h"
  26. #include "nsIUnicodeEncoder.h"
  27. #include "nsString.h"
  28. // XXX change to NS_CHARSETCONVERTERMANAGER_CID
  29. #define NS_ICHARSETCONVERTERMANAGER_CID \
  30.   {0x3c1c0163, 0x9bd0, 0x11d3, { 0x9d, 0x9, 0x0, 0x50, 0x4, 0x0, 0x7, 0xb2}}
  31. // XXX change to NS_CHARSETCONVERTERMANAGER_PID
  32. #define NS_CHARSETCONVERTERMANAGER_CONTRACTID "@mozilla.org/charset-converter-manager;1"
  33. class nsIUnicodeDecoder; /* forward declaration */
  34.  
  35. class nsIUnicodeEncoder; /* forward declaration */
  36.  
  37. class nsIUTF8StringEnumerator; /* forward declaration */
  38.  
  39.  
  40. /* starting interface:    nsICharsetConverterManager */
  41. #define NS_ICHARSETCONVERTERMANAGER_IID_STR "f5323a76-c8f7-4c65-8d0c-1250e969c7d5"
  42.  
  43. #define NS_ICHARSETCONVERTERMANAGER_IID \
  44.   {0xf5323a76, 0xc8f7, 0x4c65, \
  45.     { 0x8d, 0x0c, 0x12, 0x50, 0xe9, 0x69, 0xc7, 0xd5 }}
  46.  
  47. /**
  48.  *
  49.  * Here Charsets are indentified by ASCII strings. Charset alias
  50.  * resolution is provided by default in most methods. "Raw"
  51.  * versions that do not need this resolution are also provided.
  52.  *
  53.  * @created         21/Feb/2000
  54.  * @author  Catalin Rotaru [CATA]
  55.  */
  56. class NS_NO_VTABLE nsICharsetConverterManager : public nsISupports {
  57.  public: 
  58.  
  59.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICHARSETCONVERTERMANAGER_IID)
  60.  
  61.   /**
  62.      * Get the Unicode decoder for the given charset.
  63.      * The "Raw" version skips charset alias resolution
  64.      */
  65.   /* nsIUnicodeDecoder getUnicodeDecoder (in string charset); */
  66.   NS_IMETHOD GetUnicodeDecoder(const char *charset, nsIUnicodeDecoder **_retval) = 0;
  67.  
  68.   /* nsIUnicodeDecoder getUnicodeDecoderRaw (in string charset); */
  69.   NS_IMETHOD GetUnicodeDecoderRaw(const char *charset, nsIUnicodeDecoder **_retval) = 0;
  70.  
  71.   /**
  72.      * Get the Unicode encoder for the given charset.
  73.      * The "Raw" version skips charset alias resolution
  74.      */
  75.   /* nsIUnicodeEncoder getUnicodeEncoder (in string charset); */
  76.   NS_IMETHOD GetUnicodeEncoder(const char *charset, nsIUnicodeEncoder **_retval) = 0;
  77.  
  78.   /* nsIUnicodeEncoder getUnicodeEncoderRaw (in string charset); */
  79.   NS_IMETHOD GetUnicodeEncoderRaw(const char *charset, nsIUnicodeEncoder **_retval) = 0;
  80.  
  81.   /**
  82.      * A shortcut to calling nsICharsetAlias to do alias resolution
  83.      */
  84.   /* ACString getCharsetAlias (in string charset); */
  85.   NS_IMETHOD GetCharsetAlias(const char *charset, nsACString & _retval) = 0;
  86.  
  87.   /**
  88.      * Get the complete list of available decoders.
  89.      */
  90.   /* nsIUTF8StringEnumerator getDecoderList (); */
  91.   NS_IMETHOD GetDecoderList(nsIUTF8StringEnumerator **_retval) = 0;
  92.  
  93.   /**
  94.      * Get the complete list of available encoders.
  95.      */
  96.   /* nsIUTF8StringEnumerator getEncoderList (); */
  97.   NS_IMETHOD GetEncoderList(nsIUTF8StringEnumerator **_retval) = 0;
  98.  
  99.   /**
  100.      * Get the complete list of available charset detectors.
  101.      */
  102.   /* nsIUTF8StringEnumerator GetCharsetDetectorList (); */
  103.   NS_IMETHOD GetCharsetDetectorList(nsIUTF8StringEnumerator **_retval) = 0;
  104.  
  105.   /**
  106.      * Get the human-readable name for the given charset.
  107.      */
  108.   /* AString getCharsetTitle (in string charset); */
  109.   NS_IMETHOD GetCharsetTitle(const char *charset, nsAString & _retval) = 0;
  110.  
  111.   /**
  112.      * Get some data about the given charset. This includes whether the 
  113.      * character encoding may be used for certain purposes, if it is 
  114.      * multi-byte, and the language code for it. See charsetData.properties
  115.      * for the source of this data. Some known property names:
  116.      *    notForBrowser  - not to be used in the bowser.
  117.      *    notForOutgoing - not to be used for exporting files.
  118.      *    LangGroup      - language code for charset, e.g. 'he' and 'zh-CN'.
  119.      *    isMultibyte    - is this a multi-byte charset?
  120.      * 
  121.      * @param charset name of the character encoding, e.g. 'iso-8859-15'.
  122.      * @param prop property desired for the character encoding.
  123.      * @return the value of the property, for the character encoding.
  124.      */
  125.   /* AString getCharsetData (in string charset, in wstring prop); */
  126.   NS_IMETHOD GetCharsetData(const char *charset, const PRUnichar *prop, nsAString & _retval) = 0;
  127.  
  128.   /**
  129.      * Get the language group for the given charset. This is similar to 
  130.      * calling <tt>getCharsetData</tt> with the <tt>prop</tt> "LangGroup".
  131.      * 
  132.      * @param charset name of the character encoding, e.g. 'iso-8859-15'.
  133.      * @return the language code for the character encoding.
  134.      */
  135.   /* nsIAtom getCharsetLangGroup (in string charset); */
  136.   NS_IMETHOD GetCharsetLangGroup(const char *charset, nsIAtom **_retval) = 0;
  137.  
  138.   /* nsIAtom getCharsetLangGroupRaw (in string charset); */
  139.   NS_IMETHOD GetCharsetLangGroupRaw(const char *charset, nsIAtom **_retval) = 0;
  140.  
  141. };
  142.  
  143. /* Use this macro when declaring classes that implement this interface. */
  144. #define NS_DECL_NSICHARSETCONVERTERMANAGER \
  145.   NS_IMETHOD GetUnicodeDecoder(const char *charset, nsIUnicodeDecoder **_retval); \
  146.   NS_IMETHOD GetUnicodeDecoderRaw(const char *charset, nsIUnicodeDecoder **_retval); \
  147.   NS_IMETHOD GetUnicodeEncoder(const char *charset, nsIUnicodeEncoder **_retval); \
  148.   NS_IMETHOD GetUnicodeEncoderRaw(const char *charset, nsIUnicodeEncoder **_retval); \
  149.   NS_IMETHOD GetCharsetAlias(const char *charset, nsACString & _retval); \
  150.   NS_IMETHOD GetDecoderList(nsIUTF8StringEnumerator **_retval); \
  151.   NS_IMETHOD GetEncoderList(nsIUTF8StringEnumerator **_retval); \
  152.   NS_IMETHOD GetCharsetDetectorList(nsIUTF8StringEnumerator **_retval); \
  153.   NS_IMETHOD GetCharsetTitle(const char *charset, nsAString & _retval); \
  154.   NS_IMETHOD GetCharsetData(const char *charset, const PRUnichar *prop, nsAString & _retval); \
  155.   NS_IMETHOD GetCharsetLangGroup(const char *charset, nsIAtom **_retval); \
  156.   NS_IMETHOD GetCharsetLangGroupRaw(const char *charset, nsIAtom **_retval); 
  157.  
  158. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  159. #define NS_FORWARD_NSICHARSETCONVERTERMANAGER(_to) \
  160.   NS_IMETHOD GetUnicodeDecoder(const char *charset, nsIUnicodeDecoder **_retval) { return _to GetUnicodeDecoder(charset, _retval); } \
  161.   NS_IMETHOD GetUnicodeDecoderRaw(const char *charset, nsIUnicodeDecoder **_retval) { return _to GetUnicodeDecoderRaw(charset, _retval); } \
  162.   NS_IMETHOD GetUnicodeEncoder(const char *charset, nsIUnicodeEncoder **_retval) { return _to GetUnicodeEncoder(charset, _retval); } \
  163.   NS_IMETHOD GetUnicodeEncoderRaw(const char *charset, nsIUnicodeEncoder **_retval) { return _to GetUnicodeEncoderRaw(charset, _retval); } \
  164.   NS_IMETHOD GetCharsetAlias(const char *charset, nsACString & _retval) { return _to GetCharsetAlias(charset, _retval); } \
  165.   NS_IMETHOD GetDecoderList(nsIUTF8StringEnumerator **_retval) { return _to GetDecoderList(_retval); } \
  166.   NS_IMETHOD GetEncoderList(nsIUTF8StringEnumerator **_retval) { return _to GetEncoderList(_retval); } \
  167.   NS_IMETHOD GetCharsetDetectorList(nsIUTF8StringEnumerator **_retval) { return _to GetCharsetDetectorList(_retval); } \
  168.   NS_IMETHOD GetCharsetTitle(const char *charset, nsAString & _retval) { return _to GetCharsetTitle(charset, _retval); } \
  169.   NS_IMETHOD GetCharsetData(const char *charset, const PRUnichar *prop, nsAString & _retval) { return _to GetCharsetData(charset, prop, _retval); } \
  170.   NS_IMETHOD GetCharsetLangGroup(const char *charset, nsIAtom **_retval) { return _to GetCharsetLangGroup(charset, _retval); } \
  171.   NS_IMETHOD GetCharsetLangGroupRaw(const char *charset, nsIAtom **_retval) { return _to GetCharsetLangGroupRaw(charset, _retval); } 
  172.  
  173. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  174. #define NS_FORWARD_SAFE_NSICHARSETCONVERTERMANAGER(_to) \
  175.   NS_IMETHOD GetUnicodeDecoder(const char *charset, nsIUnicodeDecoder **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnicodeDecoder(charset, _retval); } \
  176.   NS_IMETHOD GetUnicodeDecoderRaw(const char *charset, nsIUnicodeDecoder **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnicodeDecoderRaw(charset, _retval); } \
  177.   NS_IMETHOD GetUnicodeEncoder(const char *charset, nsIUnicodeEncoder **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnicodeEncoder(charset, _retval); } \
  178.   NS_IMETHOD GetUnicodeEncoderRaw(const char *charset, nsIUnicodeEncoder **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnicodeEncoderRaw(charset, _retval); } \
  179.   NS_IMETHOD GetCharsetAlias(const char *charset, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharsetAlias(charset, _retval); } \
  180.   NS_IMETHOD GetDecoderList(nsIUTF8StringEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDecoderList(_retval); } \
  181.   NS_IMETHOD GetEncoderList(nsIUTF8StringEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEncoderList(_retval); } \
  182.   NS_IMETHOD GetCharsetDetectorList(nsIUTF8StringEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharsetDetectorList(_retval); } \
  183.   NS_IMETHOD GetCharsetTitle(const char *charset, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharsetTitle(charset, _retval); } \
  184.   NS_IMETHOD GetCharsetData(const char *charset, const PRUnichar *prop, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharsetData(charset, prop, _retval); } \
  185.   NS_IMETHOD GetCharsetLangGroup(const char *charset, nsIAtom **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharsetLangGroup(charset, _retval); } \
  186.   NS_IMETHOD GetCharsetLangGroupRaw(const char *charset, nsIAtom **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharsetLangGroupRaw(charset, _retval); } 
  187.  
  188. #if 0
  189. /* Use the code below as a template for the implementation class for this interface. */
  190.  
  191. /* Header file */
  192. class nsCharsetConverterManager : public nsICharsetConverterManager
  193. {
  194. public:
  195.   NS_DECL_ISUPPORTS
  196.   NS_DECL_NSICHARSETCONVERTERMANAGER
  197.  
  198.   nsCharsetConverterManager();
  199.  
  200. private:
  201.   ~nsCharsetConverterManager();
  202.  
  203. protected:
  204.   /* additional members */
  205. };
  206.  
  207. /* Implementation file */
  208. NS_IMPL_ISUPPORTS1(nsCharsetConverterManager, nsICharsetConverterManager)
  209.  
  210. nsCharsetConverterManager::nsCharsetConverterManager()
  211. {
  212.   /* member initializers and constructor code */
  213. }
  214.  
  215. nsCharsetConverterManager::~nsCharsetConverterManager()
  216. {
  217.   /* destructor code */
  218. }
  219.  
  220. /* nsIUnicodeDecoder getUnicodeDecoder (in string charset); */
  221. NS_IMETHODIMP nsCharsetConverterManager::GetUnicodeDecoder(const char *charset, nsIUnicodeDecoder **_retval)
  222. {
  223.     return NS_ERROR_NOT_IMPLEMENTED;
  224. }
  225.  
  226. /* nsIUnicodeDecoder getUnicodeDecoderRaw (in string charset); */
  227. NS_IMETHODIMP nsCharsetConverterManager::GetUnicodeDecoderRaw(const char *charset, nsIUnicodeDecoder **_retval)
  228. {
  229.     return NS_ERROR_NOT_IMPLEMENTED;
  230. }
  231.  
  232. /* nsIUnicodeEncoder getUnicodeEncoder (in string charset); */
  233. NS_IMETHODIMP nsCharsetConverterManager::GetUnicodeEncoder(const char *charset, nsIUnicodeEncoder **_retval)
  234. {
  235.     return NS_ERROR_NOT_IMPLEMENTED;
  236. }
  237.  
  238. /* nsIUnicodeEncoder getUnicodeEncoderRaw (in string charset); */
  239. NS_IMETHODIMP nsCharsetConverterManager::GetUnicodeEncoderRaw(const char *charset, nsIUnicodeEncoder **_retval)
  240. {
  241.     return NS_ERROR_NOT_IMPLEMENTED;
  242. }
  243.  
  244. /* ACString getCharsetAlias (in string charset); */
  245. NS_IMETHODIMP nsCharsetConverterManager::GetCharsetAlias(const char *charset, nsACString & _retval)
  246. {
  247.     return NS_ERROR_NOT_IMPLEMENTED;
  248. }
  249.  
  250. /* nsIUTF8StringEnumerator getDecoderList (); */
  251. NS_IMETHODIMP nsCharsetConverterManager::GetDecoderList(nsIUTF8StringEnumerator **_retval)
  252. {
  253.     return NS_ERROR_NOT_IMPLEMENTED;
  254. }
  255.  
  256. /* nsIUTF8StringEnumerator getEncoderList (); */
  257. NS_IMETHODIMP nsCharsetConverterManager::GetEncoderList(nsIUTF8StringEnumerator **_retval)
  258. {
  259.     return NS_ERROR_NOT_IMPLEMENTED;
  260. }
  261.  
  262. /* nsIUTF8StringEnumerator GetCharsetDetectorList (); */
  263. NS_IMETHODIMP nsCharsetConverterManager::GetCharsetDetectorList(nsIUTF8StringEnumerator **_retval)
  264. {
  265.     return NS_ERROR_NOT_IMPLEMENTED;
  266. }
  267.  
  268. /* AString getCharsetTitle (in string charset); */
  269. NS_IMETHODIMP nsCharsetConverterManager::GetCharsetTitle(const char *charset, nsAString & _retval)
  270. {
  271.     return NS_ERROR_NOT_IMPLEMENTED;
  272. }
  273.  
  274. /* AString getCharsetData (in string charset, in wstring prop); */
  275. NS_IMETHODIMP nsCharsetConverterManager::GetCharsetData(const char *charset, const PRUnichar *prop, nsAString & _retval)
  276. {
  277.     return NS_ERROR_NOT_IMPLEMENTED;
  278. }
  279.  
  280. /* nsIAtom getCharsetLangGroup (in string charset); */
  281. NS_IMETHODIMP nsCharsetConverterManager::GetCharsetLangGroup(const char *charset, nsIAtom **_retval)
  282. {
  283.     return NS_ERROR_NOT_IMPLEMENTED;
  284. }
  285.  
  286. /* nsIAtom getCharsetLangGroupRaw (in string charset); */
  287. NS_IMETHODIMP nsCharsetConverterManager::GetCharsetLangGroupRaw(const char *charset, nsIAtom **_retval)
  288. {
  289.     return NS_ERROR_NOT_IMPLEMENTED;
  290. }
  291.  
  292. /* End of implementation class template. */
  293. #endif
  294.  
  295.  
  296. #endif /* __gen_nsICharsetConverterManager_h__ */
  297.